<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="css/maintable.css"/>
    <link rel="stylesheet" type="text/css" href="css/validate.css"/>
    <style type="text/css">
        .catenametd{
            width:140px;
        }
        .secondtd{
            width:23%;
        }
    </style>
    <script type="text/javascript" src="js/jquery-1.8.0.js"></script>
</head>
<body>
<div class="div_title">
    <div class="div_titlename"><img src="images/san_jiao.gif"><span>商品分类管理</span></div>
</div>
<form method="post">
<table class="main_table">
    <tr>
        <th colspan="2">一级分类</th><th colspan="2">二级分类</th>
    </tr>
    <c:forEach var="cate" items="${cateList }">
        <tr>
            <td class="catenametd">
                <a style="color:#295568" title="${cate.des }">${cate.cateName }</a>
            </td>
            <td class="secondtd">
                <a href="cate/bigcate_edit.jsp?id=${cate.id}">修改</a> |
                <a onclick="return confirm('确定要删除此分类吗?')" href="CateServlet.do?flag=delbigcate&id=${cate.id}">删除</a>
            </td>

            <td class="catenametd">
                <c:forEach  var="cate_sub" items="${cate.subCateList }">
                    <a style="color:#295568" title="${cate_sub.des }">${cate_sub.cateName }</a> <br>
                </c:forEach>
            </td>
            <td>
                <c:forEach  var="cate_sub" items="${cate.subCateList }">
                    <a href="cate/smallcate_edit.jsp?id=${cate_sub.id}"> 修改 </a> |
                    <a onclick="return confirm('确定要删除此分类吗?')" href="CateServlet.do?flag=delsmallcate&id=${cate_sub.id}"> 删除 </a><br>
                </c:forEach>
            </td>
        </tr>
    </c:forEach>
</table>
    <label id="result_msg" class="result_msg">${msg}</label>
</form>
</body>
</html>
